<template>
	<view>
		<!-- 头 -->
		<u-sticky style="background-color:#fff;">
			<view class="margin bg-white">
				<view class="flexflex justif-between flex-align mt-5 ">
					<view class="text-xl text-bold size_18">
						问医生
					</view>
					<view class="text-bold" @click="$pub.go('/pages_my/myConsultation/myConsultation')">
						我的问诊
					</view>
				</view>
				<u-gap height="5"></u-gap>
				<block>
					<view class="search_ss">
						<u-search @click="$pub.go('/pages_home/search/search')" disabled :showAction="false"
							placeholder="输入搜索" v-model="search" :clearabled="true" searchIconColor="#7976E9"
							borderColor="#DDDDDD" bgColor="#ffffff"></u-search>
					</view>
				</block>
				<u-gap height="5"></u-gap>
			</view>
		</u-sticky>
		<!--  -->
		<view class="margin mt20">
			<view class="flexflex ms20 justif-between">
				<view class="flex-cen">
					<u-icon color="#f0ad4e" name="checkbox-mark"></u-icon>
					<view class="size_12 ml5 text-ellipsis u-warning">
						三甲医生
					</view>
				</view>
				<view class="flex-cen">
					<u-icon color="#f0ad4e" name="checkbox-mark"></u-icon>
					<view class="size_12 ml5 text-blue u-warning">
						平台认证
					</view>
				</view>
				<view class="flex-cen">
					<u-icon color="#f0ad4e" name="checkbox-mark"></u-icon>
					<view class="size_12 ml5 text-blue u-warning">
						医生7x24h
					</view>
				</view>
			</view>
		</view>
		<!--  -->
		<view class="margin">
			<u-swiper :list="list5" @change="(e) => (current = e.current)" :autoplay="false" imgMode="scaleToFill">
				<view slot="indicator" class="indicator">
					<view class="indicator__dot" v-for="(item, index) in list5" :key="index"
						:class="[index === current && 'indicator__dot--active']">
					</view>
				</view>
			</u-swiper>
		</view>
		<!--  -->
		<view class="margin mt20">
			<h3 class="ms10">
				热门科
			</h3>
			<u-grid :border="false" col="3">
				<u-grid-item v-for="(baseListItem,baseListIndex) in broadCategory"
					@click="$pub.go(`/pages_home/lock/lock?data=${baseListItem.subjectCode}`)" :key="baseListIndex">
					<u-icon :customStyle="{paddingTop:20+'rpx'}" name="photo" :size="22"></u-icon>
					<text class="grid-text text-ellipsis">{{baseListItem.subjectName || `综合科${baseListIndex}` }}</text>
				</u-grid-item>
			</u-grid>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				search: '',
				current: 0,
				list5: [
					"https://cdn.uviewui.com/uview/swiper/swiper1.png",
					"https://cdn.uviewui.com/uview/swiper/swiper2.png",
					"https://cdn.uviewui.com/uview/swiper/swiper3.png",
				],
				baseList: [{
						name: 'photo',
						title: '皮肤科'
					},
					{
						name: 'photo',
						title: '综合儿科'
					},
					{
						name: 'photo',
						title: '妇科'
					},
					{
						name: 'photo',
						title: '精神科'
					},
					{
						name: 'photo',
						title: '口腔科'
					},
					{
						name: 'photo',
						title: '耳鼻科'
					},
					{
						name: 'photo',
						title: '产科'
					},
					{
						name: 'photo',
						title: '骨科'
					},
					{
						name: 'photo',
						title: '心脏科'
					},
					{
						name: 'photo',
						title: '血管科'
					},
					{
						name: 'photo',
						title: '脚科'
					},
					{
						name: 'photo',
						title: '消化科'
					},
				],
				list0: [],
				list1: [],
				list2: [],
				type: "0",
				/*  */
				broadCategory: [],
				subclass: []
			}
		},
		methods: {
			async getListOne(code) {
				let re = await this.$API.doctorApi.getSubjectCode(code)
				console.log(re, "re");
			},
			async getListTwo(code) {
				let re = await this.$API.doctorApi.getSubjectCode(code)
				this.broadCategory = re
				console.log(re, "re");
			},
			/* 广告 */
			advertising() {
				this.request({
					url: '/devertisement/select',
				}).then(res => {
					console.log(res, "res");
					/* 资讯接口 */
					this.list5 = res.data.map((i) => {
						// return i.imagePath
						return 'http://storage.dezhoucloud.com/img/home/homeBanner.png'
					})
				})
			},
		},
		onLoad() {
			// this.getListOne(0)
			this.getListTwo(1)
			/*  */
			this.advertising();
		},
		onShow() {

		},
	}
</script>

<style scoped lang="scss">
	/* #ifdef MP */
	::v-deep .u-search__content__input {
		font-size: 28rpx !important;
	}

	/* #endif */
	page {
		background-color: #fff;
	}

	.search_ss {
		::v-deep .u-search__content__input {
			font-size: 28rpx !important;
		}
	}
</style>